import {request, tokenRequest} from "../utils/request";

export function login(js_code) {
    return request({
        url: 'user/auth/login',
        method: 'POST',
        data: {
            js_code
        },
        header: {
            'Content-type': 'application/json'
        }
    })
}

export function getInfo() {
    return tokenRequest({
        url: 'user/profile/one',
        method: 'GET',
    })
}

export function setInfo(tag, nickname, head_image, allow_stop) {
    return tokenRequest({
        url: 'user/profile/item',
        method: 'POST',
        data: {
            tag,
            nickname,
            allow_stop,
            head_image,
        },
        header: {
            'Content-type': 'application/json'
        }
    })
}